package com.jxmcloud.business.cut.enums;

import lombok.Getter;
import lombok.Setter;

public enum UserSexEnum {
    BOY(1,"男"), GIRL(0,"女");

    @Getter
    @Setter
    private Integer flag;
    private String sex;

    UserSexEnum(Integer flag, String sex) {
        this.flag = flag;
        this.sex = sex;
    }

    public static Integer getFlag(String sex) {
        for (UserSexEnum value : UserSexEnum.values()) {
            if (value.sex.equals(sex)) {
                return value.getFlag();
            }
        }
        return null;
    }
}
